home *** CD-ROM | disk | FTP | other *** search
/ Chip 1996 October / CHIP Ekim 1996.iso / winbatch / sol.wb_ < prev    next >
Text File  |  1994-09-13  |  2KB  |  76 lines

  1. ; sol.wbt
  2.  
  3. mins = AskLine("Solitaire", "How many mins do you want to play?", "")
  4. Switch mins
  5.    case 0
  6.         Display(5, "", "Game canceled")
  7.         return
  8.         break
  9.    case 1
  10.         Message("Only a minute?", "Wow! You've got willpower.")
  11.         break
  12.    case 2
  13.         Message("2 Minutes?", "This isn't much of a break.")
  14.         break
  15.    case 3
  16.         Message("3 Minutes?", "You're barely got time to shuffle")
  17.         break
  18.    case 4
  19.         Message("HA,HA,HA",  "I dare you to try to beat me.")
  20.         break
  21.    case mins    ;default case - must be last in the switch
  22.         Message("THAT LONG!!!",  "Where did you get all that time?")
  23.         break
  24. EndSwitch
  25.  
  26.  
  27. If WinExist("Solitaire") == @TRUE 
  28.      WinActivate("Solitaire")
  29. Else
  30.      Run("sol.exe", "")
  31. Endif
  32.  
  33. for i = 0 to 9
  34.         j=100-i*10
  35.         k=300+i*70
  36.         WinPlace(j,j,k,k,"Solitaire")
  37. next
  38.  
  39. WinZoom("Solitaire")
  40.  
  41. SendKey("!gc{RIGHT}{SP}~")
  42.  
  43. GoSub dumdedum
  44.  
  45. if WinExist("Solitaire") then WinHide("Solitaire")
  46.                          else exit
  47. mins=AskLine("More Time?", "Enter additional minutes", 0)
  48. WinShow("Solitaire")
  49. If mins!=0 then GoSub dumdedum
  50.  
  51. errormode(@off)
  52. while WinExist("Solitaire")
  53.         WinClose("Solitaire")
  54. endwhile
  55. errormode(@cancel)
  56.         
  57. Message("Time's Up", "Get Back to Work!")
  58. return
  59.  
  60. :dumdedum
  61. goal = mins * 60
  62. timer = 0
  63. While timer < goal
  64.         remain = goal - timer
  65.         if WinExist("Solitaire")    ; Make user user did not close it manually
  66.                 WinTitle("Solitaire", "Solitaire (%remain% seconds left)")
  67.         else
  68.                 return
  69.         endif
  70.         Delay(10)
  71.         timer = timer + 10
  72. EndWhile
  73. Return
  74.  
  75.  
  76.